package idl

type JudgeServerDetail struct {
	HostName      string  `json:"host_name" mapstructure:"host_name,omitempty"`
	Ip            string  `json:"ip" mapstructure:"ip,omitempty"`
	JudgeVersion  string  `json:"judge_version" mapstructure:"judge_version,omitempty"`
	CpuCore       int     `json:"cpu_core" mapstructure:"cpu_core,omitempty"`
	MemoryUsage   float32 `json:"memory_usage" mapstructure:"memory_usage,omitempty"`
	CpuUsage      float32 `json:"cpu_usage" mapstructure:"cpu_usage,omitempty"`
	LastHeartBeat int64   `json:"last_heartbeat" mapstructure:"last_heartbeat,omitempty"`
	CreateTime    int64   `json:"create_time" mapstructure:"create_time,omitempty"` //auto now
	TaskNumber    int     `json:"task_number" mapstructure:"task_number,omitempty"` //default=0
	ServiceUrl    string  `json:"service_url" mapstructure:"service_url,omitempty"` //null=true
	IsDisabled    bool    `json:"is_disabled" mapstructure:"is_disabled,omitempty"` //default=false
}

type JMessage struct {
	Sid        string `json:"sid" binding:"required" mapstructure:"sid,omitempty"`
	Src        string `json:"src" binding:"required" mapstructure:"src,omitempty"`           //就是提交上来的文件
	Language   string `json:"language" binding:"required" mapstructure:"language,omitempty"` //c,cpp.java,py2(可以支持golang和node,但是并不完善)
	MaxCPUTime int    `json:"max_cpu_time" binding:"required" mapstructure:"max_cpu_time,omitempty"`
	MaxMemory  int    `json:"max_memory" binding:"required" mapstructure:"max_memory,omitempty"`
	TestCaseID string `json:"test_case_id" binding:"required" mapstructure:"test_case_id,omitempty"`
}
